<template>
	<view>
		<view class="red">
			已下单，等待发货
			<image src="../../static/fel/daifahuo.png" mode="scaleToFill"></image>
		</view>
		<view class="dizhi">
		<view class="top">
			<image src="../../static/fel/daishouhuo.png" mode="scaleToFill"></image>
			<text class="name">姓名：{{xiangqing.uname}}</text>
		</view>
		<view class="addres">
			<text class="phone">手机号：{{xiangqing.uphone}}</text>
		</view>
		</view>
		<view class="shop">
			<view class="shopimg">
				<u-image width="140rpx" height="140rpx" :src="xiangqing.cartInfo[0].image"></u-image>
			</view>
			<view class="right">
				<view class="top">
					<text class="name">{{xiangqing.cartInfo[0].store_name}}</text>
					<text class="shuliang">x{{xiangqing.cartInfo[0].cart_num}}</text>
				</view>
				<view class="guige">
							{{xiangqing.cartInfo[0].attrInfo.suk}}
				</view>
				<view class="btm">
				FCFA{{xiangqing.cartInfo[0].attrInfo.price}}
				</view>
			</view>
		</view>
		<view class="xiangqing">
			<view class="top">
				<text class="le">商品总价</text>
				<text class="rl">FCFA{{xiangqing.cartInfo[0].price*xiangqing.cartInfo[0].cart_num}}</text>
			</view>
			<view class="center">
				<text class="le">优惠卷</text>
				<text class="rl">FCFA{{xiangqing.deduction_price}}</text>
			</view>
			<view class="btm">
				<text class="left">实付款</text>
				<text class="right rl">FCFA{{xiangqing.pay_price}}</text>
			</view>
		</view>
		<view class="xinxi">
			<view class="x_top">
				订单信息
			</view>
			<view class="x_center">
				<text class="x_le">订单号:</text>
				<view class="x_copy" @click="fuzhi">复制</view>
				<view class="x_ce">{{xiangqing.order_id}}</view>
			</view>
			<view class="x_btm">
				<text class="x_le">创建时间:</text>
				<view class="x_ce">{{xiangqing.add_time}}</view>
			</view>
			<view class="x_btm">
				<text class="x_le">付款时间:</text>
				<view class="x_ce">{{xiangqing.add_time}}</view>
			</view>
		</view>
		<!-- <view class="p_btm">
			<view class="p_btn qx">
				取消订单
			</view>
			<view class="p_btn zf">
				立即支付
			</view>
		</view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info: null,
				id:null,
				xiangqing: null
			};
		},
		onLoad(data) {
			this.id = data.id
				console.log(data.id);
			uni.getStorage({
				key: 'userinfo',
				success: (res) => {
					this.info = res.data
					this.getxinangqing()
				}
			})
		},
		methods: {
			fuzhi() {
				uni.setClipboardData({
					data: this.xiangqing.order_id,
					
					success: () => {
					
						this.$u.toast('复制成功')
					}
				})
			},
			getxinangqing(){
				uni.request({
					url:this.$AJAX_URL+'order/order_info',
					method:'POST',
					data:{
						uid:this.info.uid,
						order_id:this.id
					},
					success: (res) => {
						console.log(res);
						this.xiangqing = res.data.data
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #f7f7f7;
	}

	.red {
		background-color: #FF443D;
		height: 120rpx;
		line-height: 120rpx;
		// position: relative;
		overflow: hidden;
		padding-left: 42rpx;
		font-size: 32rpx;
		color: #FFFFFF;

		image {
			width: 91rpx;
			height: 91rpx;
			float: right;
			// position: absolute;
			margin-top: 15rpx;
			margin-right: 85rpx;
		}
	}



	.dizhi {
		height: 160rpx;
		background: #FFFFFF;
		padding-top: 22rpx;
		padding-left: 22rpx;

		image {
			width: 36rpx;
			height: 36rpx;
			position: relative;
			top: 10rpx;
		}

		.name {
			margin-left: 24rpx;
			color: #000000;
			font-size: 30rpx;
		}

		.phone {
			font-size: 30rpx;
			color: #808080;
		}

		.addres {
			font-size: 26rpx;
			color: #000000;
			margin-left: 60rpx;
			margin-top: 33rpx;
		}
	}

	.shop {
		height: 200rpx;
		background-color: #FFFFFF;
		display: flex;
		margin-top: 10rpx;

		.shopimg {
			padding-top: 30rpx;
			padding-left: 22rpx;
			padding-right: 20rpx;
			border-radius: 10rpx;
			overflow: hidden;
		}

		.right {
			width: 568rpx;
			padding-right: 20rpx;
			padding-top: 30rpx;

			.top {
				.name {
					font-size: 32rpx;
					color: #010101;
				}

				.shuliang {
					font-size: 24rpx;
					color: #999999;
					float: right;
				}
			}

			.guige {
				font-size: 24rpx;
				color: #999999;
				margin-top: 10rpx;
			}

			.btm {
				font-size: 32rpx;
				color: #000000;
				margin-top: 20rpx;
			}
		}
	}

	.xiangqing {
		height: 200rpx;
		padding-top: 20rpx;
		padding-left: 22rpx;
		padding-right: 20rpx;
		background-color: #FFFFFF;
		border-top: 1px solid #E6E5E5;

		.top {
			font-size: 24rpx;
			color: #999999;
		}

		.center {
			font-size: 24rpx;
			color: #999999;
			margin-top: 19rpx;
		}

		.btm {
			margin-top: 40rpx;
			color: #000000;

			.left {
				font-size: 24rpx;
			}

			.right {
				font-size: 28rpx;
			}
		}

		.rl {
			float: right;
		}

	}

	.xinxi {
		// height: 200rpx;
		background-color: #FFFFFF;
		padding-left: 20rpx;
		padding-right: 25rpx;
		padding-top: 30rpx;
		margin-top: 10rpx;
		padding-bottom: 30rpx;

		.x_top {
			font-size: 32rpx;
			color: #FF2400;
		}

		.x_center {
			position: relative;
			margin-top: 25rpx;

			.x_le {
				font-size: 28rpx;
			}

			.x_ce {
				width: 100%;
				text-align: center;
				position: absolute;
				top: 0;
				font-size: 28rpx;
			}

			.x_copy {
				position: absolute;
				color: #5288CF;
				font-size: 26rpx;
				top: 0;
				right: 0;
				z-index: 10;
			}
		}

		.x_btm {
			position: relative;
			margin-top: 10rpx;

			.x_le {
				font-size: 28rpx;
			}

			.x_ce {
				width: 100%;
				text-align: center;
				position: absolute;
				top: 0;
				font-size: 28rpx;
			}
		}
	}

	.p_btm {
		height: 98rpx;
		width: 100%;
		position: fixed;
		bottom: 0;
		background-color: #FFFFFF;

		.p_btn {
			width: 160rpx;
			height: 52rpx;
			position: absolute;
			top: 0;
			bottom: 0;
			margin: auto;
			text-align: center;
			line-height: 52rpx;
			border-radius: 26rpx;
		}

		.qx {
			border: 1px solid #E6E6E6;
			color: #E6E6E6;
			right: 214rpx;
		}

		.zf {
			border: 1px solid #FF2400;
			color: #FF2400;
			right: 24rpx;
		}
	}
</style>
